package com.xuecheng.learning.service;

import com.xuecheng.api.learning.model.dto.UserDTO;
import com.xuecheng.api.teaching.model.dto.CompanyDTO;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.common.domain.uaa.LoginUser;
import com.xuecheng.learning.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 用户信息 服务类
 * </p>
 *
 * @author itcast
 * @since 2021-04-20
 */
public interface UserService extends IService<User> {

    /**
     * 远端调用 查询 userdto
     * @param userName
     * @return
     */
    RestResponse<UserDTO> getUserByUserName(String userName);

    /**
     * 根据公司id 查询所有成员
     *
     * @param params
     * @param companyId
     * @return
     */
    PageVO<UserDTO> getUserListByCompanyId(PageRequestParams params, Long companyId);

    /**
     * 绑定用户接口
     * @param phone
     * @param companyId
     * @param user
     * @return
     */
    UserDTO getUserByPhone(String phone, Long companyId, LoginUser user);

    /**
     * 绑定成员
     * @param phone
     * @param userId
     * @param loginUser
     * @param company
     * @return
     */
    UserDTO bingUser(String phone, Long userId, LoginUser loginUser, CompanyDTO company);
}
